package com.atguigu.servicebase.exception;

import com.atguigu.servicebase.result.ResponseEnum;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class ServiceException extends RuntimeException{

    //状态码
    private Integer code;

    //错误消息
    private String message;

    public ServiceException(ResponseEnum responseEnum) {
        code = responseEnum.getCode();
        message = responseEnum.getMessage();
    }
}
